package net.xrkw.server.module.client.dal.mysql.softcategory;

import java.util.*;

import net.xrkw.server.framework.common.pojo.PageResult;
import net.xrkw.server.framework.mybatis.core.query.LambdaQueryWrapperX;
import net.xrkw.server.framework.mybatis.core.mapper.BaseMapperX;
import net.xrkw.server.module.client.dal.dataobject.softcategory.SoftCategoryDO;
import org.apache.ibatis.annotations.Mapper;
import net.xrkw.server.module.client.controller.admin.softcategory.vo.*;

/**
 * 软件分类 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SoftCategoryMapper extends BaseMapperX<SoftCategoryDO> {

    default PageResult<SoftCategoryDO> selectPage(SoftCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SoftCategoryDO>()
                .likeIfPresent(SoftCategoryDO::getCategoryName, reqVO.getCategoryName())
                .eqIfPresent(SoftCategoryDO::getSort, reqVO.getSort())
                .eqIfPresent(SoftCategoryDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(SoftCategoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SoftCategoryDO::getId));
    }

}